home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Transactor
/
Transactor_15_1987_Transactor_Publishing.d64
/
freq cntr.bas
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
927b
|
28 lines
10 rem ------- frequency counter ------
20 rem --------- lorne klassen --------
30 rem ------- east kelowna,b.c. ------
40 :
50 rem uses cnt2 (pin #6) on the user port to read in the frequency.
60 rem any signal applied to this pin must be at ttl level.
70 rem count is stored at 680 and 681.
80 rem gate time is stored at 822, overflow at 823
90 :
100 c=c+1:ifc=1thenload"freq.cntr.@c000",8,1
110 cx=-1
120 print"[147]"tab(12)"frequency counter"
130 printtab(12)"-----------------"
140 print:printtab(6)" press '+' for 1 sec. gate"
150 print:printtab(6)" press '-' for 0.1 sec. gate"
160 print:printtab(10)"any other key to quit"
170 sys 49152:rem start address
180 c=peek(680)+256*peek(681):ifc=cxthen230:rem count has not changed
190 print" [157][157][157][157][157][157][157]";c;d$,"cycles per second"
200 cx=c
210 ifpeek(823)thenprint"overflow"
220 ifpeek(823)=0thenprint" ":rem 8 spaces
230 geta$:ifa$=""then180
240 ifa$="+"thenpoke822,60:d$="":goto180
250 ifa$="-"thenpoke822,6:d$="[157]0":goto180
260 sys 49155:rem disconnect address
270 end